package com.packet.service.impl;

import com.packet.mybatis.mapper.StaffCustomsMapper;
import com.packet.mybatis.mapper.StaffTripMapper;
import com.packet.pojo.Staff;
import com.packet.pojo.Trip;
import com.packet.service.StaffTripService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName:StaffTripServiceImpl
 * @Author: mu
 * @Date:2023-12-05 17:01
 * @Describe:
 */
@Service
public class StaffTripServiceImpl implements StaffTripService {

    @Autowired
    private StaffTripMapper staffTripMapper;
    @Autowired
    private StaffCustomsMapper staffCustomsMapper;
    @Override
    public List<Trip> getOldTrip(Integer sid) {
        return  staffTripMapper.getOldTrip(sid);
    }

    @Override
    public Trip getDetailTrip(Integer bid) {
        return staffTripMapper.getDetailTrip(bid);
    }

    @Override
    public List<Trip> getDoingTrip(Integer sid) {
        return staffTripMapper.getDoingTrip(sid);
    }

    @Override
    public void addTrip(Trip trip) {
        staffTripMapper.addTrip(trip);
    }

    @Override
    public List<Staff> getManage() {
        List<Staff> manage = staffTripMapper.getManage();
        return manage;
    }

    @Override
    public void delectTrip(Integer bid) {
        staffTripMapper.deleteTrip(bid);
        staffCustomsMapper.deleteCustoms(bid);
    }

    @Override
    public Integer getNewTripBid(Integer sid) {
        return staffTripMapper.getNewTripBid(sid);
    }

    @Override
    public void updateTrip(Trip trip) {
        staffTripMapper.updateTrip(trip);
    }


}
